home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 12: Textmags & Docs / nf_archive_12.iso / MAGS / SOURCES / ATARI_SRC.ZIP / atari source / AHDI / IDEINST / PART.H < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-09  |  3.3 KB  |  130 lines

  1. /* part.h */
  2.  
  3. /*
  4.  *
  5.  * Atari Hard Disk
  6.  * Boot sector and partitioning structures.
  7.  *
  8.  *----
  9.  * 24-Feb-1986 lmd   Structures from documentation.
  10.  *
  11.  */
  12.  
  13.  
  14. /*
  15.  * Partition entry for GEMDOS root sector;
  16.  * There are four of these on the root sector;
  17.  * longs are in 68000 format.
  18.  */
  19. #define    GEMPART struct _gempart    /* partition */
  20. GEMPART {
  21.     BYTE p_flg;                /* flag byte */
  22.     BYTE p_id[3];            /* three bytes partition ID */
  23.     long p_st;                /* partition starting sector */
  24.     long p_siz;                /* partition size in sectors */
  25. };
  26.  
  27. /*
  28.  * Bits in p_flg:
  29.  */
  30. #define    P_BOOTBIT    0x80        /* 0x80, boot this partition */
  31. #define    P_EXISTS    0x01        /* 0x01, partition exists */
  32.  
  33.  
  34. /*
  35.  * Partition entry for MSDOS root sector;
  36.  * There are four of these on the root sector;
  37.  * longs are in 8086 format.
  38.  */
  39. #define    MSPART struct _mspart    /* partition */
  40. MSPART {
  41.     BYTE b_ind;                /* boot indicatior */
  42.     BYTE s_head;            /* starting head # */
  43.     BYTE s_sect;            /* starting sector # */
  44.     BYTE s_cyl;                /* starting cylinder # */
  45.     BYTE s_ind;                /* system indicatior */
  46.     BYTE e_head;            /* ending head # */
  47.     BYTE e_sect;            /* ending sector # */
  48.     BYTE e_cyl;                /* ending cylinder # */
  49.     long r_sect;            /* relative starting sector # */
  50.     long n_sect;            /* number of sectors */
  51. };
  52.  
  53.  
  54. /*
  55.  * MSDOS Master Boot Record;
  56.  * This lives on physical sector zero
  57.  * of the device, and describes the device.
  58.  *
  59.  * The structure starts at 0x200 - sizeof(MSMBR).
  60.  *
  61.  *
  62.  */
  63. #define    MSMBR struct _msmbr        /* root sector */
  64. MSMBR {
  65.     UWORD chksum;            /* for GEMDOS ONLY */
  66.     MSPART ms_p[4];            /* four partitions */
  67.     UWORD signature;            /* signature */
  68. };
  69.  
  70.  
  71. /*
  72.  * Format information is used by the Atari
  73.  * Hard Disk Format Utility to get default
  74.  * parameters for formatting the device.
  75.  *
  76.  * This is an image of part of the "set mode"
  77.  * command.
  78.  *
  79.  */
  80. #define    HINFO struct _hinfo    /* formatting information */
  81. HINFO {
  82.     WORD hi_cc;                /* cylinder count MSB / LSB */
  83.     BYTE hi_dhc;            /* number of heads */
  84.     WORD hi_rwcc;            /* reduced write current cyl */
  85.     WORD hi_wpc;            /* write precomp cyl */
  86.     BYTE hi_lz;                /* landing zone */
  87.     BYTE hi_rt;                /* step rate code */
  88.     BYTE hi_in;                /* interleave factor */
  89.     BYTE hi_spt;            /* sectors-per-track */
  90. };
  91.  
  92.  
  93. /*
  94.  * Root sector;
  95.  * This lives on physical sector zero
  96.  * of the device, and describes the device.
  97.  *
  98.  * The structure starts at 0x200 - sizeof(RSECT).
  99.  *
  100.  * longs are in 68000 format.
  101.  *
  102.  */
  103. #define    RSECT struct _rsect    /* root sector */
  104. RSECT {
  105.     HINFO hd_info;            /* formatting information */
  106.     long hd_siz;            /* size of disk, in sectors */
  107.     GEMPART hd_p[4];            /* four partitions */
  108.     long bsl_st;            /* start of bad sector list */
  109.     long bsl_cnt;            /* end of bad sector list */
  110.     WORD hd_reserved;            /* (reserved word) */
  111. };
  112.  
  113.  
  114. /*
  115.  * Bios Parameter Block
  116.  */
  117. #define BPB struct _bpb        /* BPB */
  118. BPB {
  119.     int recsiz;            /* record size in bytes */
  120.     int clsiz;            /* records per cluster */
  121.     int clsizb;            /* bytes per cluster */
  122.     int rdlen;            /* root directory length in records */
  123.     int fsiz;            /* FAT size in records */
  124.     int fatrec;            /* first FAT record of second FAT */
  125.     int datrec;            /* first data record */
  126.     int numcl;            /* available data clusters */
  127.     int b_flags;        /* flags */
  128. };
  129.  
  130.